//
//  ExhibitionService.m
//  homeland
//
//  Created by SunShine on 14-1-18.
//  Copyright (c) 2014年 xzysun. All rights reserved.
//

#import "ExhibitionService.h"

@implementation ExhibitionService

-(void)getExhibitionListForMonth:(NSString *)month Success:(void (^)(NSArray *))success Failure:(void (^)(NSString *))failure
{
    NSMutableDictionary *params = [NSMutableDictionary dictionary];
    [params setValue:month forKey:@"yearMonth"];
    MKNetworkEngine *currentEngine = [[MKNetworkEngine alloc] initWithHostName:EXHIBITION_LIST_URL customHeaderFields:nil];
    MKNetworkOperation *op = [currentEngine operationWithPath:@"" params:params httpMethod:@"POST"];
    [op addCompletionHandler:^(MKNetworkOperation *operation) {
        NSDictionary *json = [operation responseJSON];
        //转换对象,添加到列表中
        //执行回调
        success([json objectForKey:@"pageList"]);
    }errorHandler:^(MKNetworkOperation *errorOp, NSError* err) {
        //执行回调
        failure(@"请求展会信息失败.");
    }];
    [currentEngine enqueueOperation:op];
}
@end
